Skip to content

Conversation

@hamza221
Copy link
Contributor

@hamza221 hamza221 commented Aug 19, 2025

Comment on lines 1330 to 1336
$res = $qb->executeQuery();
while ($row = $res->fetch()) {
$message = $this->mapRowToEntity($row);
if ($message->getThreadRootId() === null) {
$results[] = [$message];
} else {
$results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the n+1 can be avoided with a subquery or self join

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When called from getDatabaseSyncChanges I wonder if it's even necessary to fetch messages of the same thread. We already know the new IDs. Other messages are not relevant, are they?

Comment on lines 1399 to 1405
$res = $qb->executeQuery();
while ($row = $res->fetch()) {
$message = $this->mapRowToEntity($row);
if ($message->getThreadRootId() === null) {
$results[] = [$message];
} else {
$results[] = $this->findThread($account, $message->getThreadRootId(), $sortOrder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@ChristophWurst
Copy link
Member

Looks good so far

  • BUG while clicking through mailboxes
image

@ChristophWurst
Copy link
Member

  • BUG when I click on a thread
image

@ChristophWurst
Copy link
Member

ChristophWurst commented Dec 16, 2025

Errors seen during smoke testing

  • BUG Bildschirmfoto vom 2025-12-16 10-26-59
  • BUG Bildschirmfoto vom 2025-12-16 10-26-35
  • BUG Bildschirmfoto vom 2025-12-16 10-26-15
  • BUG Bildschirmfoto vom 2025-12-16 10-26-09
  • BUG image

@ChristophWurst
Copy link
Member

  • BUG: inbox whos 22 unread. When I open some emails disappear, unread count drops to 19. When I go to another mailbox the unread count goes back to 22.

Comment on lines 2165 to 2168
const threadEnvelopes = this.threads[threadRootId]
const threadIdx = threadEnvelopes.indexOf(id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • BUG: [ERROR] mail: Background sync failed: threadEnvelopes.indexOf is not a function

view: this.getPreference('layout-message-view'),
})),
Promise.all.bind(Promise),
andThen(map(sliceToPage)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sliceToPage made sure that you always get 20 items, no matter how many mailboxes are combined.

I yet have to test it but I think without the slicing you will get 20 x number of accounts items back now.

@hamza221 hamza221 force-pushed the feat/envelope-lists branch from fac228d to ee4ce1f Compare January 12, 2026 14:50
@hamza221
Copy link
Contributor Author

hamza221 commented Jan 12, 2026

Removed the merge and rebased instead + conflicts resolution for smoother squashing later, Pushing the fixes in a bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants